package com.xyzq.model.ya.report;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.appfuse.model.BaseObject;

import com.xyzq.model.ya.data.Staff;

public class NewOpenAccount extends BaseObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7500772629115175478L;

	private Staff staff;
	private Integer openAccount;
	private Integer openShAccount;
	private Integer openSzAccount;

	public NewOpenAccount() {
		super();
	}

	public NewOpenAccount(Staff staff) {

		this.staff = staff;
		this.openAccount = 0;
		this.openShAccount = 0;
		this.openSzAccount = 0;

	}

	public Staff getStaff() {
		return staff;
	}

	public Integer getOpenAccount() {
		return openAccount;
	}

	public Integer getOpenShAccount() {
		return openShAccount;
	}

	public Integer getOpenSzAccount() {
		return openSzAccount;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public void setOpenAccount(Integer openAccount) {
		this.openAccount = openAccount;
	}

	public void setOpenShAccount(Integer openShAccount) {
		this.openShAccount = openShAccount;
	}

	public void setOpenSzAccount(Integer openSzAccount) {
		this.openSzAccount = openSzAccount;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((openAccount == null) ? 0 : openAccount.hashCode());
		result = prime * result
				+ ((openShAccount == null) ? 0 : openShAccount.hashCode());
		result = prime * result
				+ ((openSzAccount == null) ? 0 : openSzAccount.hashCode());
		result = prime * result + ((staff == null) ? 0 : staff.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NewOpenAccount other = (NewOpenAccount) obj;
		if (openAccount == null) {
			if (other.openAccount != null)
				return false;
		} else if (!openAccount.equals(other.openAccount))
			return false;
		if (openShAccount == null) {
			if (other.openShAccount != null)
				return false;
		} else if (!openShAccount.equals(other.openShAccount))
			return false;
		if (openSzAccount == null) {
			if (other.openSzAccount != null)
				return false;
		} else if (!openSzAccount.equals(other.openSzAccount))
			return false;
		if (staff == null) {
			if (other.staff != null)
				return false;
		} else if (!staff.equals(other.staff))
			return false;
		return true;
	}

	@Override
	public String toString() {
		ToStringBuilder builder = new ToStringBuilder(this);
		builder.append("staff", staff);
		builder.append("openAccount", openAccount);
		builder.append("openShAccount", openShAccount);
		builder.append("openSzAccount", openSzAccount);
		return builder.toString();
	}

}
